package com.itheima.pay;

public class Card
{
    //车牌号 车主姓名 电话号码 卡片余额
    private String number;
    private String name;
    private String phone;
    private double balance;
    public Card(){}
    public Card(String number, String name, String phone, double balance)
    {
        this.number = number;
        this.name = name;
        this.phone = phone;
        this.balance = balance;
    }
    //存钱
    public void save(double money)
    {
        balance += money;
    }

    //支付
    public void pay(double money)
    {
        balance -= money;
    }


    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Card{" +
                "number='" + number + '\'' +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", balance=" + balance +
                '}';
    }
}
